﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[DisallowMultipleComponent]
public class PersistableObject : MonoBehaviour {
    public virtual void Save (GameDataWriter writer) {
        writer.Write (transform.localPosition);
        writer.Write (transform.localRotation);
        writer.Write (transform.localScale);
    }

    public virtual void Load (GameDataRead reader) {
        transform.localPosition = reader.ReadVector3 ();
        transform.localRotation = reader.ReadQueaterion ();
        transform.localScale = reader.ReadVector3 ();
    }
}